<%-- 
    Document   : userupdate
    Created on : Sep 2, 2014, 1:35:47 AM
    Author     : thanhap
--%>
<%@page import="java.util.List"%>
<%@page import="bo2s.data.User"%>
<%@page import="bo2s.DAO.LoginDAO"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<!DOCTYPE html>
<tiles:insertTemplate template="/template_admin/TempalteAdmin.jsp">

        <tiles:putAttribute name="titleAdmin">
            User Update
	</tiles:putAttribute>
    
            <tiles:putAttribute name="contentadmin">
            <%
            int id = Integer.parseInt(request.getParameter("updateid"));
            LoginDAO eb = new LoginDAO();
            User e = eb.getUser(id);
        %>
           <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <ol class="breadcrumb">
                            <li class="active">
                                <i class="fa fa-dashboard"></i> Table Edit User :
                            </li>
                        </ol>
                    </div>
                </div>
                <!-- /.row -->
                <div class="row">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <div class="row">
        <form id="form" name="form" action="${pageContext.request.contextPath}/UpdateServlet" method="post">
                <h3 ALIGN="CENTER">Update User ID :<%=e.getId()%></h3>
                <table class="table">
                        <tbody>
                            <tr>
                                <td><label><input type="hidden" name="id" id="id" value="<%=e.getId()%>"/><span class="small"></span></label></td>
                                <td><input type="hidden" name="id" value="<%=e.getId()%>"/></td>
                            </tr>
                            <tr>
                                <td><label>User Name:</label></td>
                                <td><input type="text" name="username" value="<%=e.getUsername()%>"/></td>
                            </tr>
                            <tr>
                                <td><label>Password:</label></td>
                                <td><input type="text" name="password" value="<%=e.getPassword()%>"/></td>
                            </tr>
                            <tr>
                                <td><label>Full Name:</label></td>
                                <td><input type="text" name="fullname" value="<%=e.getFullname()%>"/></td>
                            </tr>
                            <tr>
                                <td><label>Email:</label></td>
                                <td><input type="text" name="email" id="empName" value="<%=e.getEmail()%>"/></td>
                            </tr>
                            <tr>
                                <td><label>Phone:</label></td>
                                <td><input type="text" name="phone" value="<%=e.getPhone()%>"/></td>
                            </tr>
                            <tr>
                                <td><label>Address:</label></td>
                                <td><input type="text" name="address" value="<%=e.getAddress()%>"/></td>
                            </tr>
                            <tr>
                                <td><label>Gender:</label></td>
                                <td><input type="text" name="gender" value="<%=e.getGender()%>"/></td>
                            </tr>
                            <tr>
                                <td><label>Image:</label></td>
                                <td><input type="text" name="image" value="<%=e.getImage()%>"/></td>
                            </tr>
                            <tr>
                                <td><label>Role:</label></td>
                                <td><input type="text" name="role" value="<%=e.getRole()%>"/></td>
                            </tr>  
                        </tbody>
                </table>
                <div class="col-lg-12 text-center">
                <button type="submit" class="btn btn-xl">Update Employee</button>
                </div>
            </form> </div>
                            </div>
                                <div class="panel-footer">
                                    <span><%@include file="adminmanager.jsp"%></span>
                                    <div class="clearfix"></div>
                                </div>
                        </div> 
                                    </div>
                    
                <!-- /.row -->
                    </div>
            </tiles:putAttribute>
</tiles:insertTemplate>

